<template>
	<view>
		<teacherProfile ref="profile" v-if="role == 'teacher' " :userInfo="userInfo" />
		<supplierProfile ref="profile" v-else-if="role == 'supplier' " :userInfo="userInfo" />
		<parentProfile ref="profile" :userInfo="userInfo" v-else />
	</view>
</template>
<script>
	import parentProfile from './index/parentProfile.vue'
	import teacherProfile from './index/teacherProfile.vue'
	import supplierProfile from './index/supplierProfile.vue'
	export default {
		components: {
			parentProfile,
			teacherProfile,
			supplierProfile
		},
		data(){
			return {
				role: 'parent',
				userInfo: {},
				moduleMap:{
					parent: 'parentProfile',
					teacher: 'teacherProfile',
					supplier: 'supplierProfile',
				}
			}
		},
		onShow(){
			this.$nextTick(() => {
				this.$refs.profile.load()
			})
		}
	}
</script>